<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>按车型名查询</title>
<style type="text/css">
  body{
    width:1280px;
    margin:0 auto;
  }
  table tr th, table tr td {
    text-align:center;
  }
  .pageList{
    float:right;
    clear:both;
  }
  .pageList_foot{
    clear:both;
    margin-bottom:20px;
    text-align:center;
  }
  .modelList{
    float:right;
    clear:both;
    width:100%;
  }
</style>
<script>
  function pre(){
    var pageNo = parseInt(document.getElementById("pageNo").value);
    if (pageNo > 1) {
      pageNo = pageNo - 1;
    }
    goPage(pageNo);
  }
  function next() {
    var pageNo = parseInt(document.getElementById("pageNo").value);
    var totalPage = parseInt(document.getElementById("totalPage").value);
    if (pageNo < totalPage) {
      pageNo = pageNo + 1;
    }
    goPage(pageNo);
  }
  function last() {
    var totalPage = parseInt(document.getElementById("totalPage").value);
    goPage(totalPage);
  }
  function goPage(pageNo) {
    var currentPage = parseInt(document.getElementById("pageNo").value);
    var totalPage = parseInt(document.getElementById("totalPage").value);
    if (currentPage == 1 && pageNo == 1) {
      alert("已在首页");
      return false;
    }
    if (currentPage == totalPage && pageNo == totalPage) {
      alert("已达最后一页");
      return false;
    }
    location.href="showAutoModel.action?pageNo="+pageNo;
  }
</script>
</head>
<body>
	<div class="ab-head">
	<s:include value="/WEB-INF/page/car/common/head.jsp"></s:include>
	</div>
	<div class="pageList">
	共${totalRecordCount}条记录,当前是第${currentPage}页，共${totalPage}页
	<a href="javascript:void(0)" onclick="goPage(1)">首页</a>&nbsp;<a href="javascript:void(0)" onclick="pre()">上一页</a>&nbsp;<a href="javascript:void(0)" onclick="next()">下一页</a>&nbsp;<a href="javascript:void(0)" onclick="last()">最后一页</a>&nbsp;
	</div>
	<div class="modelList">
	  <table border="1" cellpadding="0" cellspacing="0" width="100%">
	    <thead>
	      <tr>
	        <th>来源网站</th>
	        <th>图片</th>
	        <th>品牌</th>
	        <th>厂商</th>
	        <th>系列</th>
	        <th>name</th>
	        <th>官方价</th>
	        <th>油耗</th>
	        <th>保修政策</th>
	        <th>产地</th>
	        <th>级别</th>
	        <th>最高车速</th>
	        <th>排量(L)</th>
	        <th>款型</th>
	        <th>0-100加速时间</th>
	      </tr>
	    </thead>
	    <tbody>
	    <s:iterator id="list" value="#request.autoModelList" status="st">
	      <tr>
	        <td><s:property value="host"/></td>
	        <td><img src="<s:property value="picture"/>" width="120" height="90"/></td>
	        <td><s:property value="brand"/></td>
	        <td><s:property value="factory"/></td>
	        <td><s:property value="series"/></td>
	        <td><a href="<s:property value="outlink"/>" target="_blank"><s:property value="name"/></a></td>
	        <td><s:property value="official_price"/></td>
	        <td><s:property value="oil_consumption"/></td>
	        <td><s:property value="guarantee"/></td>
	        <td><s:property value="origin"/></td>
	        <td><s:property value="grade"/></td>
	        <td><s:property value="max_speed"/></td>
	        <td><s:property value="emission"/></td>
	        <td><s:property value="model"/></td>
	        <td><s:property value="acceleration"/></td>
	      </tr>
	    </s:iterator>
	    </tbody>
	  </table>
	</div>
	<div class="pageList_foot">
	共${totalRecordCount}条记录,当前是第${currentPage}页，共${totalPage}页
	<a href="javascript:void(0)" onclick="goPage(1)">首页</a>&nbsp;<a href="javascript:void(0)" onclick="pre()">上一页</a>&nbsp;<a href="javascript:void(0)" onclick="next()">下一页</a>&nbsp;<a href="javascript:void(0)" onclick="last()">最后一页</a>&nbsp;
	</div>
	<input type="hidden" name="pageSize" id="pageSize" value="${pagesize}"/>
	<input type="hidden" name="currentPage" id="currentPage" value="${currentPage}"/>
	<input type="hidden" name="pageNo" id="pageNo" value="${pageNo}"/>
	<input type="hidden" name="totalPage" id="totalPage" value="${totalPage}"/>
</body>
</html>
